home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Development Platforms / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / ToolUtils.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  3.1 KB  |  116 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Sunday, January 6, 1991 at 11:25 PM
  3.     ToolUtils.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc.    1985-1990
  7.         All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT ToolUtils;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingToolUtils}
  21. {$SETC UsingToolUtils := 1}
  22.  
  23. {$I+}
  24. {$SETC ToolUtilsIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingQuickdraw}
  27. {$I $$Shell(PInterfaces)Quickdraw.p}
  28. {$ENDC}
  29. {$SETC UsingIncludes := ToolUtilsIncludes}
  30.  
  31. CONST
  32. sysPatListID = 0;
  33. iBeamCursor = 1;
  34. crossCursor = 2;
  35. plusCursor = 3;
  36. watchCursor = 4;
  37.  
  38. TYPE
  39. Int64Bit = RECORD
  40.     hiLong: LONGINT;
  41.     loLong: LONGINT;
  42.     END;
  43.  
  44.  
  45. FUNCTION FixRatio(numer: INTEGER;denom: INTEGER): Fixed;
  46.     INLINE $A869;
  47. FUNCTION FixMul(a: Fixed;b: Fixed): Fixed;
  48.     INLINE $A868;
  49. FUNCTION FixRound(x: Fixed): INTEGER;
  50.     INLINE $A86C;
  51. FUNCTION GetString(stringID: INTEGER): StringHandle;
  52.     INLINE $A9BA;
  53. FUNCTION Munger(h: Handle;offset: LONGINT;ptr1: Ptr;len1: LONGINT;ptr2: Ptr;
  54.     len2: LONGINT): LONGINT;
  55.     INLINE $A9E0;
  56. PROCEDURE PackBits(VAR srcPtr: Ptr;VAR dstPtr: Ptr;srcBytes: INTEGER);
  57.     INLINE $A8CF;
  58. PROCEDURE UnpackBits(VAR srcPtr: Ptr;VAR dstPtr: Ptr;dstBytes: INTEGER);
  59.     INLINE $A8D0;
  60. FUNCTION BitTst(bytePtr: Ptr;bitNum: LONGINT): BOOLEAN;
  61.     INLINE $A85D;
  62. PROCEDURE BitSet(bytePtr: Ptr;bitNum: LONGINT);
  63.     INLINE $A85E;
  64. PROCEDURE BitClr(bytePtr: Ptr;bitNum: LONGINT);
  65.     INLINE $A85F;
  66. FUNCTION BitAnd(value1: LONGINT;value2: LONGINT): LONGINT;
  67.     INLINE $A858;
  68. FUNCTION BitOr(value1: LONGINT;value2: LONGINT): LONGINT;
  69.     INLINE $A85B;
  70. FUNCTION BitXor(value1: LONGINT;value2: LONGINT): LONGINT;
  71.     INLINE $A859;
  72. FUNCTION BitNot(value: LONGINT): LONGINT;
  73.     INLINE $A85A;
  74. FUNCTION BitShift(value: LONGINT;count: INTEGER): LONGINT;
  75.     INLINE $A85C;
  76. FUNCTION HiWord(x: LONGINT): INTEGER;
  77.     INLINE $A86A;
  78. FUNCTION LoWord(x: LONGINT): INTEGER;
  79.     INLINE $A86B;
  80. PROCEDURE LongMul(a: LONGINT;b: LONGINT;VAR result: Int64Bit);
  81.     INLINE $A867;
  82. FUNCTION GetIcon(iconID: INTEGER): Handle;
  83.     INLINE $A9BB;
  84. PROCEDURE PlotIcon(theRect: Rect;theIcon: Handle);
  85.     INLINE $A94B;
  86. FUNCTION GetPattern(patternID: INTEGER): PatHandle;
  87.     INLINE $A9B8;
  88. FUNCTION GetCursor(cursorID: INTEGER): CursHandle;
  89.     INLINE $A9B9;
  90. FUNCTION GetPicture(pictureID: INTEGER): PicHandle;
  91.     INLINE $A9BC;
  92. FUNCTION SlopeFromAngle(angle: INTEGER): Fixed;
  93.     INLINE $A8BC;
  94. FUNCTION AngleFromSlope(slope: Fixed): INTEGER;
  95.     INLINE $A8C4;
  96. PROCEDURE SetString(theString: StringHandle;strNew: Str255);
  97.     INLINE $A907;
  98. FUNCTION DeltaPoint(ptA: Point;ptB: Point): LONGINT;
  99.     INLINE $A94F;
  100. FUNCTION NewString(theString: Str255): StringHandle;
  101.     INLINE $A906;
  102. PROCEDURE ShieldCursor(shieldRect: Rect;offsetPt: Point);
  103.     INLINE $A855;
  104. PROCEDURE GetIndString(VAR theString: Str255;strListID: INTEGER;index: INTEGER);
  105. PROCEDURE ScreenRes(VAR scrnHRes: INTEGER;VAR scrnVRes: INTEGER);
  106.     INLINE $225F,$32B8,$0102,$225F,$32B8,$0104;
  107. PROCEDURE GetIndPattern(VAR thePat: Pattern;patternListID: INTEGER;index: INTEGER);
  108.  
  109.  
  110. {$ENDC}    { UsingToolUtils }
  111.  
  112. {$IFC NOT UsingIncludes}
  113.     END.
  114. {$ENDC}
  115.  
  116.